home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / Drivers / vc_2_2.lha / ParNet / Source / pio_wakeup.asm < prev    next >
Encoding:
Assembly Source File  |  1994-11-02  |  1.7 KB  |  96 lines

  1. **
  2. ** $Header: SRC:CVSROOT/Vector/ParNet/pio_wakeup.asm,v 1.1.1.1 1994/06/23 02:39:40 Barnard Exp $
  3. **
  4.  
  5. **
  6. ** This code was originally written by Matthew Dillon and put into Public Domain
  7. **
  8. ** All changes concerning the adaption of Matt's original code to the
  9. ** Vector Connection I/O board are © 1991-1994 by Henning Schmiedehausen
  10. ** All rights for this changes are reserved. The original code is Public Domain
  11. **
  12. ** This code is distributed with the expressed written permission of Matthew
  13. ** Dillon (Thank you very much, Matt)
  14. **
  15. **
  16.  
  17.         ;   WAKEUP.ASM
  18.         ;
  19.  
  20.         INCLUDE "exec/types.i"
  21.         INCLUDE "exec/execbase.i"
  22.         INCLUDE "exec/io.i"
  23.         INCLUDE "vector/vectorpar.i"
  24.  
  25.         section __MERGED,DATA
  26.  
  27.         xdef    _VTask
  28.         xdef    _VMask
  29.  
  30.         xref    _PIOBase
  31.         xref    _UnitBase
  32.         xref    PIOIntBit
  33.  
  34. _VTask        dc.l    0
  35. _VMask        dc.l    0
  36.  
  37.  
  38.         ;   ICR interrupt
  39.  
  40.         section text,code
  41.  
  42.         xref    _SysBase
  43.         xref    _LVOSignal
  44.  
  45.         xdef    _PioInt
  46.         xdef    _ClearPIOInt
  47.         xdef    _SetPIOInt
  48.  
  49. _PioInt:    movem.l    d1-d7/a0-a6,-(a7)
  50.  
  51.         move.l    _PIOBase,a1
  52.         move.b    PIO_PSR(a1),d0
  53.         btst.l    #PIOIntBit,d0
  54.         bne.s    .isMine
  55.  
  56.         movem.l    (a7)+,d1-d7/a0-a6
  57.         moveq    #0,d0
  58.         rts
  59.  
  60. .isMine        jsr    _ClearPIOInt
  61.  
  62.         move.l    _SysBase,A6
  63.         move.l    _VTask,A1
  64.         move.l    _VMask,D0
  65.         jsr    _LVOSignal(A6)
  66.  
  67. ;        movea.l #LED,a1            ; test-toggle power LED
  68. ;        move.b    (a1),d0
  69. ;        bchg    #1,d0
  70. ;        move.b    d0,(a1)
  71.  
  72.         movem.l    (sp)+,d1-d7/a0-a6    ; restore registers
  73.         moveq.l #1,D0        ; clear interrupt.
  74.         rts
  75.  
  76. _ClearPIOInt:    move.l    _UnitBase,a1
  77.         bclr.b    #1,PIOR_PCR(a1)        ; Interrupts sperren
  78.  
  79.         move.l    _PIOBase,a1
  80.         moveq    #0,d0
  81.         bset.l    #PIOIntBit,d0
  82.         move.b    d0,PIO_PSR(a1)        ; Interrupt löschen
  83.  
  84.         rts
  85.  
  86. _SetPIOInt:    move.l    _UnitBase,a1
  87.         bset.b    #1,PIOR_PCR(a1)        ; Interrupts freigeben
  88.  
  89.         rts
  90.  
  91.         END
  92.  
  93.  
  94.  
  95.  
  96.